//C11.18:stone.cpp -- user-defined conversions
// compile with stonewt.cpp
#include <iostream>
using std::cout;
#include "stonewt.h"

void display(const Stonewt &st, int n);
int main(void)
{
    Stonewt incoginto = 275;   // use constructor to initialize
    Stonewt wolfe(285.7);      // same as Stonewt wolfe = 285.7;
    Stonewt taft(21, 8);

    cout << "The celebrity weighted ";
    incoginto.show_stn();
    cout << "The detective weighted ";
    wolfe.show_stn();
    cout << "The President weighted ";
    taft.show_lbs();
    incoginto = 276.8;          // uses constructor for conversion
    taft = 325;                 // same as taft = Stonewt(325);
    cout << "After dinner, the celebrity weighted ";
    incoginto.show_stn();
    cout << "After dinner, the President weighted ";
    taft.show_lbs();
    display(taft, 2);
    cout << "The wrestler weighted even more.\n";
    display(422, 2);
    cout << "No stone left unearned\n";
}

void display(const Stonewt &st, int n)
{
    for(int i = 0; i < n; i ++)
    {
        cout << "Wow! ";
        st.show_stn();
    }
}